package com.yunquan.ohana.entity

import com.yunquan.ohana.utils.ColorData
import com.yunquan.ohana.utils.ColorUtil

data class HomeInformationModel(
    var schedules: MutableList<ScheduleModel>? = null,
    var scheduleCount: Int? = null,
    var taskCount: Int? = null,
    var listCount: Int? = null,
    var profilesCount: Int? = null,
    var profilesMaxCount: Int? = null,
    var profilesBindingQuantity: Int? = null,
    var roleId: String? = null,
    // 1管理员，0普通用户
    var userType: Int? = null,
)

data class ScheduleModel(
    var id: String? = null,
    var title: String? = null,
    var description: String? = null,
    var startTime: String? = null,
    var endTime: String? = null,
    var allDay: Int? = null, // 是否全天日程
    var location: String? = null,
    var recurrence: String? = null, // 重复规则
    var reminder: String? = null, // 提醒时间（分钟）
    var repeats: String? = null, // 是否重复
    var every: Int? = null, // 重复间隔
    var repetitiveTime: String? = null, // 重复时间
    var deviceId: String? = null,
    var roleId: String? = null,
    var userId: String? = null,
    var repeatsUntil: String? = null, // 循环结束时间
    var scheduleToRoleVos: MutableList<ScheduleRoleModel>? = null,
    // 用于显示的日期与时间
    var startDate: String? = null,
    var startTimeStr: String? = null,
    var endDate: String? = null,
    var endTimeStr: String? = null,
    // 重复日程的原始数据，用于编辑
    var original: ScheduleModel? = null,
)

data class ScheduleModelVo(
    var id: String? = null,
    var deviceId: String? = null,
    var title: String? = null,
    var startTime: Long? = null,
    var endTime: Long? = null,
    var allDay: Int? = null, // 是否全天日程
    var recurrence: String? = null, // 重复规则
    var repeats: String? = null, // 是否重复
    var every: Int? = null, // 重复间隔
    var repetitiveTime: String? = null, // 重复时间
    var repeatsUntil: String? = null, // 循环结束时间
    var deviceRoleDtoList: MutableList<MutableMap<String, Any?>>? = null,
)

data class ScheduleRoleModel(
    var id: String? = null,
    var scheduleId: String? = null,
    var roleId: String? = null,
    var roleName: String? = null,
    var backgroundColor: String? = null,
    var status: Int? = null,
    var type: Int? = null,
) {
    fun getColorData(): ColorData {
        return ColorUtil.getColor(backgroundColor?.toInt() ?: 0)
    }
}

data class RoleEntity(
    var backgroundColor: String?,
    var deviceId: String?,
    var email: String?,
    var account: String?,
    var id: String?,
    var name: String?,
    //1代表本人绑定，2未绑定，3其他人绑定
    var type: Int?,
) {
    fun getColorData(): ColorData {
        return ColorUtil.getColor(backgroundColor?.toInt() ?: 0)
    }
}

data class SchedulesVo(
    val deviceId: String? = null,//设备id
    val startTime: String? = null,//开始时间
    val endTime: String? = null,//结束时间
    val roleIds: List<String>? = null,//查询角色Id
    val status: Int? = null,//完成状态
    val scheduleId: String? = null,//日程id
    val title: String? = null,//文案
)

data class CalendarEvent(
    var title:String? = null,
    var description:String? = null,
    var events: MutableList<ScheduleModelVo>,
)